//去空格
function checkspace(checkstr) {
	var str = '';
	for(i = 0; i < checkstr.length; i++) 
	{
		str = str + ' ';
	}
	return (str == checkstr);
}
function check_message(formlist){	
   	if (checkspace(formlist.realname.value))
	{alert("请输入姓名！");
	formlist.realname.focus();
	return false;
	}
	
 	if (checkspace(formlist.phone.value))
	{alert("请输入联络电话！");
	formlist.phone.focus();
	return false;
	}
	
  	if (checkspace(formlist.email.value))
	{alert("请输入电邮地址！");
	formlist.email.focus();
	return false;
	}
	
   	if (formlist.email.value.indexOf("@")=="-1"||formlist.email.value.indexOf(".")=="-1")
	{alert("请输入电邮地址！");
	formlist.email.focus();
	return false;
	}
	
 	if (checkspace(formlist.message.value))
	{alert("请输入内容！");
	formlist.message.focus();
	return false;
	}
}

function check_orders(formlist){	
   	if (checkspace(formlist.realname.value))
	{alert("请输入姓名！");
	formlist.realname.focus();
	return false;
	}
	
 	if (checkspace(formlist.tel.value))
	{alert("请输入手机号码！");
	formlist.tel.focus();
	return false;
	}
	
  	if (checkspace(formlist.email.value))
	{alert("请输入电子邮箱！");
	formlist.email.focus();
	return false;
	}
	
   	if (formlist.email.value.indexOf("@")=="-1"||formlist.email.value.indexOf(".")=="-1")
	{alert("请输入电子邮箱！");
	formlist.email.focus();
	return false;
	}
}